package UILayer;

/**
 * The Option class keeps information about the options that are displayed by MenuLists.
 * The purpose of the Option class is to be able to create parametrized option lists in the Menu class.
 * It groups the options that the user can choose from, its textual descriptions and the represented 
 * objects. 
 * It is used exclusively by the MenuList class, and it is the MenuList class which is responsible to 
 * instantiate the Option objects.
 * 
 * @author anna
 *
 * @param <T>
 */
public class Option<T> {
	private String choice;
	private String text;
	private T choiceObj;
	
	/**
	 * Constructor for option objects.
	 * @param choice
	 * @param text
	 * @param choiceObj
	 */
	public Option(String choice, String text, T choiceObj) {
		super();
		this.choice = choice;
		this.text = text;
		this.choiceObj = choiceObj;
	}
	
	/**
	 * Returns the options number or symbol. Fx. y for yes or n for no.
	 * @return choice The number or symbol for the option.
	 */
	public String getChoice() {
		return choice;
	}
	
	/**
	 * Returns the description of the option.
	 * @return text The description of the option.
	 */
	public String getText() {
		return text;
	}
	
	/**
	 * Returns a refeReturns the objectrence of the object that is represented by the option. 
	 * The type of the object can be any type.
	 * @return choiceObj A reference of the object that is represented by the option.
	 */
	public T getChoiceObj() {
		return choiceObj;
	}

}
